package org.xg.study.pd;

/**
 * @author CMG
 * @version 1.0
 * @cLassName Singleton_02
 * @description 懒汉模式(线程安全)
 * @date 2021/9/14 9:37
 **/
public class Singleton_02 {
    private static Singleton_02 instance;

    private Singleton_02(){

    }

    public static synchronized Singleton_02 getInstance(){
        if(null != instance){
            return instance;
        }
        instance = new Singleton_02();
        return instance;
    }
}
